package com.itheima;


import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import com.itheima.service.impl.BookServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
       //获取IOC容器
        ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");

        //获取bean
        BookService bookService = (BookService) ctx.getBean("bookService");
        BookService bookService1 = (BookService) ctx.getBean("bookService");

        //调用方法
       /* bookService.save();*/
        System.out.println(bookService);
        System.out.println(bookService1);

       /* //dao
        //获取bean
        BookDao bookDao = (BookDao) ctx.getBean("bookDao");
        bookDao.save();*/
    }
}
